import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs";

const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/apartment";

//新增批次
const apiAccommodation = {
    //用户楼宇授权删除
    Deletes: function (authIds) {
        const data = {
            authIds
        };
        return request({
            url: baseUrl + "/houseBuilding/deletes",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //安排验房
    InsertInspect: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/houseRoomIn/insertInspect", data, config)
    },
    Save: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/houseRoomIn/save", data, config)
    },
    //住宿管理列表
    List: function (buildId, floorNum, roomTypeId, searchValue) {
        const data = {
            buildId, floorNum, roomTypeId, searchValue
        };
        return request({
            url: baseUrl + "/houseRoomIn/list",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //待办--房源列表
    SelectAllBySky: function (buildId, floorNum, roomTypeId, searchValue) {
        const data = {
            buildId, floorNum, roomTypeId, searchValue
        };
        return request({
            url: baseUrl + "/houseRoomIn/selectAllBySky",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //楼宇下拉列表
    buildingList: function (areaId, userId) {
        const data = {
            areaId, userId
        };
        return request({
            url: baseUrl + "/houseBuilding/buildingList",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //楼宇下拉列表(楼宇权限)
    buildingAuthList: function (areaId) {
        const data = {
            areaId
        };
        return request({
            url: baseUrl + "/houseBuilding/buildingAuthListByAreaId",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //楼宇下拉列表(楼宇权限)
    GetDetailByRoomInIdAndRoomId: function (roomId, roomInId) {
        const data = {
            roomId, roomInId
        };
        return request({
            url: baseUrl + "/houseRoomIn/getDetailByRoomInIdAndRoomId",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //楼宇下拉列表(楼宇权限)
    getByRoomId: function (roomId) {
        const data = {
            roomId
        };
        return request({
            url: baseUrl + "/houseRoomIn/getByRoomId",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //根据用户id获取住户信息
    GetByUserId: function (roomInId, status, userId) {
        const data = {
            roomInId,
            status,
            userId
        };
        return request({
            url: baseUrl + "/houseRoomIn/getByUserId",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //根据部门展示对应部门用户
    GetUserByDeptId: function (deptId) {
        const data = {
            deptId
        };
        return request({
            url: baseUrl + "/houseRoomIn/getUserByDeptId",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //查询所有用户
    GetUserAll: function () {
        const data = {

        };
        return request({
            url: baseUrl + "/houseRoomIn/getUserAll",
            method: "post",
            data: qs.stringify(data),
        });
    },

}
export {
    apiAccommodation
}